//
//  TimeSegSettingViewController.m
//  test
//
//  Created by 刘杨 on 14-10-13.
//  Copyright (c) 2014年 刘杨. All rights reserved.
//

#import "TimeSegSettingViewController.h"

@interface TimeSegSettingViewController ()

@end

@implementation TimeSegSettingViewController

- (void)viewDidLoad {
    originalRedValue = 0.75000;
    originalGreenValue = 0.75000;
    originalBlueValue = 0.75000;
    
    selectedRedValue = 0;
    selectedGreenValue = 0;
    selectedBlueValue = 0;
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

-(void) viewDidAppear:(BOOL)animated{
    NSLog(@"aaaaaaaaaaaaaaaaaaaa");
    //nodeLabel.text = message;
    
}

- (IBAction)onWeekDayClick:(id)sender{
    UIButton *button = (UIButton *)sender;
    //UIColor *testColor1= [UIColor colorWithRed:240/255.0 green:240/255.0 blue:240/255.0 alpha:1];
    UIColor *testColor1 = button.backgroundColor;
    const CGFloat * component = CGColorGetComponents(testColor1.CGColor);
    NSLog(@"%f",component[0]);
    NSLog(@"%f",component[1]);
    NSLog(@"%f",component[2]);
    if(component[0] != originalRedValue) {
        NSLog(@"original color");
        UIColor * targetColor= [UIColor colorWithRed:originalRedValue green:originalRedValue blue:originalRedValue alpha:1];
        button.backgroundColor = targetColor;
    }else{
        NSLog(@"selected color");
        button.backgroundColor = [UIColor orangeColor];
        
    }
}

- (IBAction)onHourClick:(id)sender{
    UIButton *button = (UIButton *)sender;
    //UIColor *testColor1= [UIColor colorWithRed:240/255.0 green:240/255.0 blue:240/255.0 alpha:1];
    UIColor *testColor1 = button.backgroundColor;
    const CGFloat * component = CGColorGetComponents(testColor1.CGColor);
    NSLog(@"%f",component[0]);
    NSLog(@"%f",component[1]);
    NSLog(@"%f",component[2]);
    if(component[0] != originalRedValue) {
        NSLog(@"original color");
        UIColor * targetColor= [UIColor colorWithRed:originalRedValue green:originalRedValue blue:originalRedValue alpha:1];
        button.backgroundColor = targetColor;
    }else{
        NSLog(@"selected color");
        button.backgroundColor = [UIColor orangeColor];
        
    }
}

@end
